<?php

// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.ctolog.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目：https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------

namespace app\store\service;

use think\Db;

/**
 * 商品数据服务支持
 * Class ProductService
 * @package app\goods\service
 */
class CompanyProfileDietService
{

    /**
     * 公告表数据处理
     * @param array $goodsList
     * @return array
     */
    public static function buildCompanyProfileDietList(&$goodsList)
    {
        // 无商品列表时
        if (empty($goodsList)) {
            return ['list' => $goodsList];
        }
        // 读取商品详情列表
        $specWhere = [['is_deleted', 'eq', '0'], ['id', 'in', array_column($goodsList, 'id')]];
        $specField = 'id,title,picture,content,create_at,status';

        $goodsList = Db::name('StoreCompanyProfileDiet')->where($specWhere)->column($specField);


        return ['list' => $goodsList];
    }
}